import request from "@/utils/request";

// 获取1688采集商品列表
export function queryCollectList(data) {
  return request({
    url: "/collect/collect/product/list",
    method: "get",
    params: data
  })
}

// 删除1688采集商品
export function deleteCollectProd(data) {
  return request({
    url: `/collect/collect/product/removeById/${data.id}`,
    method: "delete",
  })
}

// 保存1688采集商品
export function saveCollectProdImg(data) {
  return request({
    url: "/collect/collect/product/update/img",
    method: "post",
    data
  })
}

// 1688商品图片
export function queryCollectProdImg(data) {
  return request({
    url: `/collect/collect/product/imgMap/${data.id}`,
    method: "get",
    params: data
  })
}

// 切换1688商品图片
export function changeCollectProdImg(data) {
  return request({
    url: `/collect/collect/product/imgMap/next/${data.id}/${data.type}`,
    method: "get",
  })
}

// 1688商品生成白底图片
export function generateWhite(data) {
  return request({
    url: `/collect/collect/product/generateWhite`,
    method: "get",
    params: data
  })
}

// 1688商品生成营销图片
export function generateMarketing(data) {
  return request({
    url: `/collect/collect/product/generateMarketing`,
    method: "get",
    params: data
  })
}


// 微唯宝商品列表
export function queryWeiweibaoList(data) {
  return request({
    url: "/wwbcollect/wwb/collect/product/list",
    method: "get",
    params: data
  })
}

// 是否保留微唯宝商品
export function isSaveProduct(data) {
  return request({
    // url: `/wwbcollect/wwb/collect/product/imgMap/next/${data.id}/${data.next}/${data.isSave}`,
    url: `/wwbcollect/wwb/collect/product/imgMap/next`,
    method: "post",
    data
  })
}

// 获取微唯宝商品详情
export function queryProductDetail(id) {
  return request({
    url: `/wwbcollect/wwb/collect/product/imgMap/${id}`,
    method: "get",
  })
}
